import%20marimo%0A%0A__generated_with%20%3D%20%220.17.6%22%0Aapp%20%3D%20marimo.App(auto_download%3D%5B%22ipynb%22%2C%20%22html%22%5D)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20import%20pytz%0A%20%20%20%20import%20datetime%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20india_timezone%20%3D%20pytz.timezone(%22Asia%2FKolkata%22)%0A%20%20%20%20now%20%3D%20datetime.datetime.now(india_timezone)%0A%0A%20%20%20%20curr%20%3D%20now.strftime(%22%25Y-%25m-%25d%2C%20%25I%3A%25M%3A%25S%20%25p%20%25Z%22)%0A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20rf%22%22%22%0A%20%20%20%20%23%20Week%20-%201%20(Dataset%20-%202)%0A%0A%20%20%20%20**Submission%20Date%3A**%20%602025-10-05%2C%2023%3A59%20IST%60%0A%0A%20%20%20%20**Last%20Updated%3A**%20%60%7Bcurr%7D%60%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20pandas%20as%20pd%0A%20%20%20%20return%20np%2C%20pd%0A%0A%0A%40app.cell%0Adef%20_(pd)%3A%0A%20%20%20%20df%20%3D%20pd.read_csv(%22Week-1%2FGraded%20Assignment%201.2%2FWeek1_GA_dataset-2.csv%22)%0A%20%20%20%20return%20(df%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Basic%20Dataset%20Inspection%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20assert%20df.shape%20%3D%3D%20(10000%2C%2012)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.head()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.describe()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.info()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.isnull().sum()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Basic%20Cleaning%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df%2C%20np)%3A%0A%20%20%20%20df.replace(%22%3F%22%2C%20np.nan%2C%20inplace%3DTrue)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%201%0A%0A%20%20%20%20Select%20all%20the%20even%20indexed%20rows%20from%20the%20given%20dataset.%20What%20is%20the%20value%20in%20the%203rd%20indexed%20column%20of%20the%200th%20indexed%20row%20in%20the%20selected%20dataframe.%20(row%2F%20column%20indexed%20from%20zero(0)%20in%20python%2Fpandas)%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B%3A%3A2%2C%20%3A%5D.iloc%5B0%2C%203%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%23%23%20Question%202%0A%0A%20%20%20%20Select%20all%20the%20even%20indexed%20rows%20from%20the%20given%20dataset.%20What%20is%20the%20value%20in%20the%203rd%20indexed%20column%20of%20the%20332th%20indexed%20row%20in%20the%20selected%20dataframe.%20(row%2F%20column%20indexed%20from%20zero(0))%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B%3A%3A2%2C%20%3A%5D.iloc%5B332%2C%203%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%203%0A%0A%20%20%20%20Select%20all%20the%20odd%20indexed%20rows%20from%20the%20given%20dataset.%20What%20is%20the%20value%20in%20the%203rd%20indexed%20column%20of%20the%20332th%20indexed%20row%20in%20the%20selected%20dataframe.%20(row%2F%20column%20indexed%20from%20zero(0))%0A%0A%20%20%20%20%3E%20Please%20consider%20case%20sensitivity%20while%20giving%20your%20solution%20capital%20letter%20%E2%89%A0%20small%20letter.%20If%20it%20is%20a%20string%20don't%20write%20quotes%20in%20the%20solution.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B1%3A%3A2%2C%20%3A%5D.iloc%5B332%2C%203%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%204%0A%0A%20%20%20%20Select%20all%20the%20odd%20indexed%20columns%20from%20the%20given%20dataset.%20What%20is%20the%20value%20in%20the%205th%20indexed%20column%20of%20the%20100th%20indexed%20row%20in%20the%20selected%20dataframe.%20(row%2F%20column%20indexed%20from%20zero(0))%0A%0A%20%20%20%20%3E%20Please%20consider%20case%20sensitivity%20while%20giving%20your%20solution%20capital%20letter%20%E2%89%A0%20small%20letter.%20If%20it%20is%20a%20string%20don't%20write%20quotes%20in%20the%20solution.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B1%3A%3A2%2C%20%3A%5D.iloc%5B100%2C%205%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%205%0A%0A%20%20%20%20Select%20all%20the%20even%20indexed%20columns%20and%20even%20indexed%20rows%20from%20the%20given%20dataset.%20What%20is%20the%20value%20in%20the%203th%20indexed%20column%20of%20the%20255th%20indexed%20row%20in%20the%20selected%20dataframe.%20(row%2F%20column%20indexed%2Fstarts%20from%20zero(0))%0A%0A%20%20%20%20%3E%20Please%20consider%20case%20sensitivity%20while%20giving%20your%20solution%20capital%20letter%20%E2%89%A0%20small%20letter.%20If%20it%20is%20a%20string%20don't%20write%20quotes%20in%20the%20solution.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B%3A%3A2%2C%20%3A%3A2%5D.iloc%5B255%2C%203%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%206%0A%0A%20%20%20%20Determine%20the%20number%20of%20samples%20(rows)%20in%20the%20dataset%20that%20belong%20to%20the%20six%20most%20recent%20years%2C%20based%20on%20the%20provided%20data.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df%5Bdf%5B%22Year%22%5D.isin(sorted(df%5B%22Year%22%5D.unique()%2C%20reverse%3DTrue)%5B%3A6%5D)%5D.shape%5B0%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%207%0A%0A%20%20%20%20Determine%20the%20number%20of%20samples%20(rows)%20in%20the%20dataset%20which%20has%20num_rooms%20%3D%203%20and%20num_bathrooms%20%3D%203%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df%5B(df%5B%22num_rooms%22%5D%20%3D%3D%203)%20%26%20(df%5B%22num_bathrooms%22%5D%20%3D%3D%203)%5D.shape%5B0%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%208%0A%0A%20%20%20%20Determine%20the%20number%20of%20samples%20(rows)%20in%20the%20dataset%20which%20has%20num_rooms%20%3D%203%20or%20num_bathrooms%20%3D%203%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df%5B(df%5B%22num_rooms%22%5D%20%3D%3D%203)%20%7C%20(df%5B%22num_bathrooms%22%5D%20%3D%3D%203)%5D.shape%5B0%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%209%0A%0A%20%20%20%20In%20the%20**Year**%202022%2C%20how%20many%20houses%20(rows)%20located%20in%20the%20Greenwich%20**Locality**%20have%20exactly%20**num_room**%20%3D%3D%203%2C%20and%20**facing**%20towards%20either%20the%20North%20or%20East%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df%5B%0A%20%20%20%20%20%20%20%20(df%5B%22Year%22%5D%20%3D%3D%202022)%0A%20%20%20%20%20%20%20%20%26%20(df%5B%22Locality%22%5D%20%3D%3D%20%22Greenwich%22)%0A%20%20%20%20%20%20%20%20%26%20(df%5B%22num_rooms%22%5D%20%3D%3D%203)%0A%20%20%20%20%20%20%20%20%26%20(df%5B%22Face%22%5D.isin(%5B%22North%22%2C%20%22East%22%5D))%0A%20%20%20%20%5D.shape%5B0%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%2010%0A%0A%20%20%20%20Calculate%20the%20number%20of%20samples(rows)%20that%20correspond%20to%20the%20month%20of%20August%20across%20all%20the%20years.%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%23%20Convert%20%60Date%60%20to%20%60datetime%60%20object%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df%2C%20pd)%3A%0A%20%20%20%20df%5B%22Date%22%5D%20%3D%20pd.to_datetime(df%5B%22Date%22%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%23%20Filter%20data%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df%5Bdf%5B%22Date%22%5D.dt.month%20%3D%3D%208%5D.shape%5B0%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%2011%0A%0A%20%20%20%20According%20to%20the%20data%20which%20Locality%20have%20highest%20average%20Sale%20Price%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.groupby(%22Locality%22)%5B%22Sale%20Price%22%5D.mean().idxmax()%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
113d6770063cd27f97f51057151e11e8857ab1ba9cf47c312334aa102332b7ac